#ifndef _HCC_ERROR_CODE_MID_CAN_H_
#define _HCC_ERROR_CODE_MID_CAN_H_

#include "ofc/ofc_types.h"
#include "hcc/hcc_error_code.h"
#include "hcc/hcc_error_code_app.h"

#ifdef __cplusplus
extern "C" {
#endif

// 不含行号的错误码生成
#define HCC_MAKE_MID_CAN_ERROR(error_code) (int)HCC_MAKE_APP_ERROR(kHccAppCanServer, error_code, HCC_ERROR_LEVEL_ERROR)
// 含行号的错误码生成
#define HCC_MAKE_MID_CAN_ERROR_LINE(error_code) (int)HCC_ERROR(HCC_MAKE_APP_ERROR(kHccAppCanServer, error_code, HCC_ERROR_LEVEL_ERROR))


/**
 * Can:can总线
 */
enum THccMidCanErrorCodeEnumTag
{
	kHccMidCanSuccess	=	HCC_ERROR_SUCCESS,			///< 成功,没有错误
	kHccMidCanParamInvalid	=	HCC_MAKE_MID_CAN_ERROR(1),			///<参数错误
	kHccMidCanRegFailed	=	HCC_MAKE_MID_CAN_ERROR(2),			///<注册失败
	kHccMidCanBaudAdaptiving	=	HCC_MAKE_MID_CAN_ERROR(3),			///<波特率自适应中
	kHccMidCanSetBaudFailed	=	HCC_MAKE_MID_CAN_ERROR(4),			///<设置波特率失败
	kHccMidCanSetModeFailed	=	HCC_MAKE_MID_CAN_ERROR(5),			///<设置工作模式失败
	kHccMidCanPostMsgFailed	=	HCC_MAKE_MID_CAN_ERROR(6),			///<发送消息失败
	kHccMidCanDevOpenFailed	=	HCC_MAKE_MID_CAN_ERROR(7),			///<设备打开失败
	kHccMidCanDevDetecting	=	HCC_MAKE_MID_CAN_ERROR(8),			///<正在波特率检测中
	kHccMidCanRegFrameIdFailed	=	HCC_MAKE_MID_CAN_ERROR(9),			///<注册透传id失败
	kHccMidCanUnRegFrameIdFailed	=	HCC_MAKE_MID_CAN_ERROR(10),			///<注销透传id失败
	kHccMidCanDbcEncodeFailed	=	HCC_MAKE_MID_CAN_ERROR(11),			///<dbc编码失败
	kHccMidCanDbcDecodeFailed	=	HCC_MAKE_MID_CAN_ERROR(12),			///<dbc解码失败
	kHccMidCanBaudAdaptiveFailed	=	HCC_MAKE_MID_CAN_ERROR(13),			///<波特率自适应失败
	kHccMidCanPlugTypeFailed	=	HCC_MAKE_MID_CAN_ERROR(14),			///<插件类型错误
};
typedef enum THccMidCanErrorCodeEnumTag THccMidCanErrorCodeEnum;


typedef Int32 THccMidCanErrorCodeEnumLine;
#define kHccMidCanSuccessLine	HCC_ERROR_SUCCESS	///< 成功,没有错误
#define kHccMidCanParamInvalidLine	HCC_MAKE_MID_CAN_ERROR_LINE(1)	///<参数错误
#define kHccMidCanRegFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(2)	///<注册失败
#define kHccMidCanBaudAdaptivingLine	HCC_MAKE_MID_CAN_ERROR_LINE(3)	///<波特率自适应中
#define kHccMidCanSetBaudFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(4)	///<设置波特率失败
#define kHccMidCanSetModeFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(5)	///<设置工作模式失败
#define kHccMidCanPostMsgFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(6)	///<发送消息失败
#define kHccMidCanDevOpenFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(7)	///<设备打开失败
#define kHccMidCanDevDetectingLine	HCC_MAKE_MID_CAN_ERROR_LINE(8)	///<正在波特率检测中
#define kHccMidCanRegFrameIdFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(9)	///<注册透传id失败
#define kHccMidCanUnRegFrameIdFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(10)	///<注销透传id失败
#define kHccMidCanDbcEncodeFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(11)	///<dbc编码失败
#define kHccMidCanDbcDecodeFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(12)	///<dbc解码失败
#define kHccMidCanBaudAdaptiveFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(13)	///<波特率自适应失败
#define kHccMidCanPlugTypeFailedLine	HCC_MAKE_MID_CAN_ERROR_LINE(14)	///<插件类型错误

//旧版本适配补丁
#define kHccMidCanCodeSuccess kHccMidCanSuccess


#ifdef __cplusplus
}  // extern "C"
#endif

#endif // _HCC_ERROR_CODE_MID_CAN_H_
/**
 * @
 */
